package com.sunspring.jbug.aop;

import com.sunspring.jbug.common.SimpleResponse;
import com.sunspring.jbug.common.exception.JbugException;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

/**
 * @Author: wulei
 * @Date: 2019/3/8
 */
@RestControllerAdvice
public class GlobalExceptionHandler {


    @ExceptionHandler(JbugException.class)
    public SimpleResponse catchJBugException(Exception ex) {
        return SimpleResponse.error(ex.getMessage());
    }



}
